package com.fansl.allround.open.api.feign;

import com.fansl.allround.common.core.constant.ServiceNameConstants;
import com.fansl.allround.common.core.constant.enums.EmailMessageTypeEnum;
import com.fansl.allround.open.api.feign.factory.RemoteJuHeServiceFallbackFactory;
import com.fansl.allround.open.api.vo.EmailCodeVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/10/10 17:22
 */
@FeignClient(contextId = "remoteEmailService",value = ServiceNameConstants.OPEN_SERVICE,
        fallbackFactory = RemoteJuHeServiceFallbackFactory.class,path = "/email")
public interface RemoteEmailService {
    /**
     * 发送邮件验证码
     * @param receiver
     * @param emailMessageType
     * @return
     */
    @PostMapping("/code")
    EmailCodeVO sendEmailCode(@RequestParam("receiver") String receiver,
                                     @RequestParam("emailMessageType") EmailMessageTypeEnum emailMessageType);
}
